<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/1/5
 * Time: 14:51
 */

namespace common\components\ActionsComponents;

use yii\web\Response;

/**
 * 验证码
 * Class CaptchaAction
 * @package common\components\ActionsComponents
 */
Class CaptchaAction extends \yii\captcha\CaptchaAction
{
    public $autoRegenerate = true;

    public function run()
    {
        $this->setHttpHeaders();
        \Yii::$app->response->format = Response::FORMAT_RAW;
        return $this->renderImage($this->getVerifyCode($this->autoRegenerate));
    }
}